package com.probox.common.entity.vo.statistics;

import cn.hutool.core.util.ObjectUtil;
import com.probox.common.core.annotation.Excel;
import com.probox.common.core.utils.StringUtils;
import com.probox.common.core.utils.money.MoneyUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class CardConsumptionSaleVo implements Serializable {

    private String type;

    private Long proUid;

    private Long serviceId;

    private Long storeId;

    private String platSource;

    private List<Long> storeIds;

    private List<String> sourcePlatform;

    /**
     * 名称
     */
    @Excel(name = "项目名称", sort = 1)
    private String name;

    /**
     * 数量
     */
    @Excel(name = "耗卡数量", sort = 2)
    private Long number;

    /**
     * 销售金额
     */
    private Long amount;

    @Excel(name = "耗卡金额", sort = 4)
    private Double haoKa;


    public String getAmountStr() {
        if (ObjectUtil.isEmpty(amount)) return "0";
        return MoneyUtils.changeF2Y(amount);
    }

    /**
     * 数量占比
     */
    private String numberProportion;

    @Excel(name = "耗卡数量占比率", sort = 3)
    private String numberProportionStr;

    public String getNumberProportionStr() {
        if (StringUtils.isEmpty(numberProportion)) return "0%";
        return MoneyUtils.changeStrPercentage(numberProportion);
    }

    /**
     * 销售金额占比
     */
    @Excel(name = "耗卡金额占比率", sort = 5)
    private String amountProportionStr;

    private String amountProportion;

    public String getAmountProportionStr() {
        if (StringUtils.isEmpty(amountProportion)) return "0%";
        return MoneyUtils.changeStrPercentage(amountProportion);
    }

    private String startTime;

    private String endTime;


    private Integer pageSize;

    private Integer pageNum;
}
